package basicTypes;

import java.sql.Date;
import java.sql.SQLException;

import db.RADAO;

public class RALogExt extends RALog {
	private RAClient client;
	private RAResource resource;
	private RAClient masterRequester = new RAClient(0,"Master Admin",true,"root");
	public RALogExt(int id, Integer client, Integer resource, String op,
			String desc, Date d) {
		super(id, client, resource, op, desc,d);

		RAClient c = null;
		RAResource r = null;
		try {
			c = RADAO.getInstance().db_getClient(masterRequester, this.getClientID().intValue());
			r = RADAO.getInstance().db_getResource(masterRequester, this.getResourceID());
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
		}
		this.client=c;
		this.resource=r;
	}

	public RAClient getMasterRequester() {
		return masterRequester;
	}

	public void setMasterRequester(RAClient masterRequester) {
		this.masterRequester = masterRequester;
	}

	public void setClient(RAClient client) {
		this.client = client;
	}

	public void setResource(RAResource resource) {
		this.resource = resource;
	}

	public RAClient getClient() {
		return client;
	}
	
	public RAResource getResource() {
		return resource;
	}
	

}
